package com.ruoyi.zsyh.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhPartsQrcodeMapper;
import com.ruoyi.zsyh.domain.ZsyhPartsQrcode;
import com.ruoyi.zsyh.service.IZsyhPartsQrcodeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 二维码记录Service业务层处理
 * 
 * @author yuexl
 * @date 2022-01-09
 */
@Service
public class ZsyhPartsQrcodeServiceImpl implements IZsyhPartsQrcodeService 
{
    @Autowired
    private ZsyhPartsQrcodeMapper zsyhPartsQrcodeMapper;

    /**
     * 查询二维码记录
     * 
     * @param qrcodeId 二维码记录ID
     * @return 二维码记录
     */
    @Override
    public ZsyhPartsQrcode selectZsyhPartsQrcodeById(String qrcodeId)
    {
        return zsyhPartsQrcodeMapper.selectZsyhPartsQrcodeById(qrcodeId);
    }

    public ZsyhPartsQrcode selectZsyhPartsQrcodeByQrCodeFirst(String qrcodeFirst){
        return zsyhPartsQrcodeMapper.selectZsyhPartsQrcodeByQrCodeFirst(qrcodeFirst);
    }

    /**
     * 查询二维码记录列表
     * 
     * @param zsyhPartsQrcode 二维码记录
     * @return 二维码记录
     */
    @Override
    public List<ZsyhPartsQrcode> selectZsyhPartsQrcodeList(ZsyhPartsQrcode zsyhPartsQrcode)
    {
        return zsyhPartsQrcodeMapper.selectZsyhPartsQrcodeList(zsyhPartsQrcode);
    }

    /**
     * 新增二维码记录
     * 
     * @param zsyhPartsQrcode 二维码记录
     * @return 结果
     */
    @Override
    public int insertZsyhPartsQrcode(ZsyhPartsQrcode zsyhPartsQrcode)
    {
        zsyhPartsQrcode.setCreateTime(DateUtils.getNowDate());
        return zsyhPartsQrcodeMapper.insertZsyhPartsQrcode(zsyhPartsQrcode);
    }

    /**
     * 修改二维码记录
     * 
     * @param zsyhPartsQrcode 二维码记录
     * @return 结果
     */
    @Override
    public int updateZsyhPartsQrcode(ZsyhPartsQrcode zsyhPartsQrcode)
    {
        return zsyhPartsQrcodeMapper.updateZsyhPartsQrcode(zsyhPartsQrcode);
    }

    /**
     * 删除二维码记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsQrcodeByIds(String ids)
    {
        return zsyhPartsQrcodeMapper.deleteZsyhPartsQrcodeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除二维码记录信息
     * 
     * @param qrcodeId 二维码记录ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsQrcodeById(String qrcodeId)
    {
        return zsyhPartsQrcodeMapper.deleteZsyhPartsQrcodeById(qrcodeId);
    }

    @Override
    public int selectCount(String qrcode) {
        return zsyhPartsQrcodeMapper.selectCount(qrcode);
    }


    public Map getQrcodeInformation(String qrCode){
        return zsyhPartsQrcodeMapper.getQrcodeInformation(qrCode);
    }


    public Map getQrcodeInformationByQrCodeFirst(String qrCodeFirst){
        return zsyhPartsQrcodeMapper.getQrcodeInformationByQrCodeFirst(qrCodeFirst);
    }

}
